package com.gjzt.business.callBackLog.controller;

import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.eastdigit.servlet.RequestAttribute;
import com.eastdigit.servlet.Response;
import com.eastdigit.servlet.ReqBean;
import com.gjzt.business.callBackLog.service.CallBackLogService;

/**
 * 银联后台通知回调日志
 * @author zwm
 *
 */
@Controller
@RequestMapping(value = "/callBackLog")
public class CallBackLogController {

    @Autowired
    private CallBackLogService callBackLogService;

    /**
     * 查询
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/query")
    @ResponseBody
    public JSONObject queryCallBackLog(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        return Response.response(callBackLogService.findCallBackLog(reqBean));
    }

    /**
     * 添加
     *
     * @param reqBean
     * @return
     */
   /* @RequestMapping(value = "/add")
    @ResponseBody
    public JSONObject addCallBackLog(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        callBackLogService.addCallBackLog(reqBean);
        return Response.responseSuccess();
    }*/

    /**
     * 修改
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/update")
    @ResponseBody
    public JSONObject updateCallBackLog(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        callBackLogService.updateCallBackLog(reqBean);
        return Response.responseSuccess();
    }

    /**
     * 删除
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/delete")
    @ResponseBody
    public JSONObject removeCallBackLog(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        callBackLogService.removeCallBackLog(reqBean);
        return Response.responseSuccess();
    }

    //TODO 其他功能
}